﻿@using AFT.Parking.Bizlogic.Coordinate
@model AFT.Parking.Entity.ParkingMonitor
@{
    ViewBag.Title = "编辑设备";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="content-box">
    <div class="content-box-header">
        <h3 style="cursor: s-resize">编辑设备信息</h3>
        <div class="clear"></div>
    </div>

    <div class="content-box-content">
        <div class="tab-content default-tab" id="tab2">
            <form method="POST" id="frm">
                <fieldset>
                    <p>
                        <label>停车区</label>
                        @Html.TextBox("ParkingAreaId", Model.ParkingAreaId, new { @type = "hidden" })
                        <input type="hidden" value="@Model.ParkingAreaId" />
                        <span>@ViewBag.ParkingAreaName</span>
                    </p>
                    <p>
                        <label>设备名称</label>
                        @Html.TextBox("Name", Model.Name, new { @class = "text-input medium-input" })
                    </p>
                    <p>
                        <label>车牌区监测(从A到B)</label>
                        A:
                        <input type="hidden" id="from" value="@Model.ShareFrom"/>
                        <select name="ShareFrom" class="text-input small-input" data-bind="text:shareFrom">
                            <option value="-1">--请选择--</option>
                            @foreach (var sharesFrom in ViewBag.AreaShares)
                            {
                                <option value="@sharesFrom.Id">@sharesFrom.ShareName</option>
                            }
                        </select>
                        -->
                        B:
                        <input type="hidden" id="to" value="@Model.ShareTo" />
                        <select name="ShareTo" class="text-input small-input" data-bind="text:shareTo">
                            <option value="-1">--请选择--</option>
                            @foreach (var sharesTo in ViewBag.AreaShares)
                            {
                                <option value="@sharesTo.Id">@sharesTo.ShareName</option>
                            }
                        </select>
                        @*<span class="input-notification error png_bg">Error message</span>*@
                    </p>
                    <p>
                        <label>IP地址</label>
                        @Html.TextBox("Ip", Model.Ip, new { @class = "text-input small-input" })
                    </p>
                    <p>
                        <label>端口</label>
                        @Html.TextBox("Port", Model.Port, new { @class = "text-input small-input" })
                    </p>
                    <p>
                        <input class="button" type="submit" id="btnSubmit" value=" 保 存 " />
                        <input class="button" type="button" id="btnBack" value=" 返 回 " /> <br />
                        <span class="input-notification @ViewBag.Icon png_bg">@ViewBag.Message</span>
                        <input type="hidden" id="hd_backUrl" value="/parkingCamera/CameraList?mallAreaId=@Model.ParkingAreaId">
                    </p>
                </fieldset>
                <div class="clear"></div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function() {
        $("select[name='ShareFrom']").val($("#from").val());
        $("select[name='ShareTo']").val($("#to").val());
    })
</script>
